package snowyjuhannus.common.tests;

import static org.junit.Assert.*;
//Check how to define "package"
import snowyjuhannus.common.Lift;

import org.junit.After;
import org.junit.Test;

public class LiftTests {

	Lift testLift;
	
	@After
	public void teardown(){
		testLift = null;
	}
	
	//Check how to "define constructor"
	@Test
	public void ToString_ValidParametersKg_ValidStringRepresentation() {
		testLift = new Lift(65.5f, "kg");
		//Check how to "override toString()-method"
		String testString = testLift.toString();
		assertTrue("String does not match Expected; "+testString, testString.equals("Lift: 65,50kg"));
	}
	
	@Test
	public void ToString_ValidParametersLbs_ValidStringRepresentation() {
		testLift = new Lift(144.40f, "lbs");
		//Check how to "override toString()-method"
		String testString = testLift.toString();
		assertTrue("String does not match Expected; "+testString, testString.equals("Lift: 144,40lbs"));
	}
	
	@Test
	public void GetUnit_validUnitkg_UnitInString() {
		testLift = new Lift(65.5f, "kg");
		//Check how to "generate getter for private field"
		String testString = testLift.GetUnit();
		assertTrue("String does not match Expected; "+testString, testString.equals("kg"));
	}
	
	@Test
	public void GetUnit_validUnitlbs_UnitInString() {
		testLift = new Lift(144.40f, "lbs");
		//Check how to "generate getter for private field"
		String testString = testLift.GetUnit();
		assertTrue("String does not match Expected; "+testString, testString.equals("lbs"));
	}

}
